Most modern computers include at least one form of data storage that has programmable address translation or mapping. In most computers, this storage will be provided by a relatively high-speed system memory, which is usually implemented using random-access memory (RAM) components (DRAM and SRAM).
Although system memory is usually fast, it does have its weaknesses. First, it is usually volatile. Second, for a given amount of data to be stored, system memory takes up more physical space within the computer, is more expensive, and requires more support in terms of cooling, component sockets, etc., than does a conventional non-volatile storage device such as a disk. Thus, whereas many gigabytes of disk storage are commonly included in even computers in the relatively unsophisticated consumer market, such computers seldom come with more than a few GB of system RAM.
Because higher speed access to stored data and code usually translates into faster performance, it is generally preferable to run as much of an active application from system memory as possible. Indeed, many applications requiring real-time processing of complex calculations, such as voice-recognition software, interactive graphics, etc., will not run properly or run at all unless a certain amount of RAM is reserved for their use while running.
High-speed system memory is a limited resource and, as with most limited resources, there is often competition for it. This has become an even greater problem in modern multi-tasked systems, in which several applications may be running or, at least resident in memory, at the same time. Even where there is enough memory in a given system for all of the applications that need it, it is still often advantageous to conserve memory use: RAM costs money, and consumes both energy and physical space. More efficient management of RAM can reduce the cost, energy, or physical space required to support a given workload. Alternatively, more efficient management of RAM can allow a system to support a larger number of applications with good performance, given a fixed monetary, energy, or physical space budget.
Using known virtualization techniques, multiple virtual machines (VMs), each having a guest operating system, may share a single physical host. When several VMs are executing on one physical host, there is an opportunity for consolidating memory as various VMs may use identical or similar pages. One technique for reducing the amount of system memory required for a given workload, and thereby for effectively “expanding” the amount of available system memory, is to implement a scheme whereby different VMs share the memory space. Transparent page sharing, in the context of a multi-processor system on which virtual machines are running, is one known method for saving RAM space. The basic idea is to save memory by eliminating redundant copies of memory pages, such as those that contain program code or file system buffer cache data. This is especially important for reducing memory overheads associated with running multiple copies of operating systems (e.g., multiple guest operating systems each running in a respective virtual machine). Further related information is provided in U.S. Pat. No. 6,075,938, to Bugnion, et al., “Virtual Machine Monitors for Scalable Multiprocessors,” issued 13 Jun. 2000 (“Bugnion '938”).
According to another technique, the contents of pages in memory are hashed and their hash numbers are compared to identify potentially identical pages. The entire content of potentially positive candidates is compared to verify that they store identical content. When identical pages are found, only one is selected and protected by using a known copy-on-write (COW) technique, while the other page is eliminated to free the memory space. This technique is particularly advantageous in that it does not require any modification of the guest operating system (OS). Further relevant information is described in U.S. Pat. No. 6,789,156, to Waldspurger, “Content-Based, Transparent Sharing of Memory Units,” issued Sep. 7, 2004.